package setupapplication.core;

import java.util.ArrayList;

import setupapplication.data.UserSettings;
import setupapplication.logic.SetUserData;
import setupapplication.ui.UserMessage;
import stardecision.data.UserDecision;

public class SetupRunner  implements Runnable_Interface {
	
	String decision;
	@Override
	public void run() {
		
		do {
			
			userMessage();
			decision = getDecisionFromUser();
			ArrayList<String> parametrs = null;
			String url = null;
			String fileName = null;
			String attackType = null;
			UserSettings userSettings = new UserSettings(url, parametrs, fileName, attackType);
			userSettings = setUserAction(userSettings, decision);
			
		}while(decision.equals("exit") == false);
		
	}
	
	private UserSettings setUserAction(UserSettings userSettings, String decision) {
		SetUserData setUserData = new SetUserData();
		
		userSettings = setUserData.setupData(userSettings, decision);
		return userSettings;
		
	}

	private String getDecisionFromUser() {
		
		UserDecision userDecision = new UserDecision();
		decision = userDecision.getDecisionFromUser();
		return decision;
		
	}
	
	private void userMessage() {
		
		UserMessage userMessage = new UserMessage();
		userMessage.message();
		
	}

}
